********************************************************************************
* Date: 06/21/2022															   *
* Replication Do-File for: 												       *
*						 "Curse of the Mummy-ji:					  	 	   *
* 			The influence of Mothers-in-Law on Women in India"  			   *
* By: S Anukriti, Catalina Herrera-Almanza, Praveen K.Pathak, and Mahesh Karra *
********************************************************************************
* This do file replicates all tables presented in the paper	and 			   *
* in the online appendix 													   * 
********************************************************************************
* I. Directory &  Data reading
********************************************************************************

clear all
set more off

global repo "WRITE-HERE-YOUR-PATH"
use "$repo\ajae_data.dta", clear 

********************************************************************************
****************** MAIN PAPER / TABLES AND FIGURE  *****************************
********************************************************************************


********************************************************************************
* Table 1 Summary statistics
********************************************************************************

global sumstat age husb_age SC ST OBC Upper  w1_hindu school_yrs durationmarriage w1_age_at_marriage ///
livewMIL ownland amountland no_sons no_children firstbornson ///
visitfriend visithealth visitkirana visitshort visitmkt visit_out ghunghat work modern_method ever_visit_fp

* Export table:
estpost summ $sumstat 
esttab using "$repo/tables/table1.tex" , ///
cells("count(fmt(0)) mean(fmt(2)) sd(fmt(2)) min(fmt(0)) max(fmt(0))") ///
nomtitle noobs nonumber label collabels(none)  varwidth(25) ///
varlabels(visitfriend "\emph{Allowed to visit alone:} & & & & & \\ Home of relatives/friends" ) ///
prehead("\begin{table}[htpb]\begin{center}\caption{Summary statistics}\label{table:table1} \resizebox{0.85\linewidth}{!}{\begin{tabular}{lccccc}\toprule & N & Mean & SD & Min & Max \\ & (1) & (2) & (3) & (4) & (5) \\  \midrule ") ///
posthead("") ///
postfoot("\bottomrule  \\[-5ex] \end{tabular}}\end{center} \begin{tablenotes} Notes: This table describes the characteristics of our sample. Columns (1)–(5) report, respectively, the number of observations, the mean, the standard deviation, the minimum, and the maximum value for each variable. SC, ST, and OBC denote, respectively scheduled caste, scheduled tribe, and other backward class. \end{tablenotes} \end{table}" ) nogaps replace


********************************************************************************
* Table 2 
********************************************************************************

eststo clear
est drop _all

global cov age school_yrs i.sub_caste3 w1_hindu i.village_n amountland miss_land

foreach y in N_F_same_village outsider{
qui: reg `y' livewMIL $cov, cluster(village_n)
est store `y'1
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL $cov, cluster(village_n)
est store `y'2
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom18_in_hh $cov, cluster(village_n)
est store `y'3
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom1830_in_hh $cov, cluster(village_n)
est store `y'4
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom1830m_in_hh $cov, cluster(village_n)
est store `y'5
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	

}

esttab  N_F_same_village* using "$repo/tables/table2.tex" , ///
keep(livewMIL livewFIL other_wom18_in_hh other_wom1830_in_hh other_wom1830m_in_hh)  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean, fmt(%9.2f %9.0g) label("Control mean")) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Number of Peers, OLS}\label{table:table2}\begin{tabular}{lccccc} \toprule") ///
posthead(" \emph{Co-residence with:} &  (1) & (2) & (3) & (4) & (5) \\ \midrule & \multicolumn{5}{c}{A. Outcome: \# close peers in the village}  \\ ") ///
postfoot("") ///
 varwidth(25)  replace

esttab  outsider* using "$repo/tables/table2.tex",  ///
keep(livewMIL livewFIL other_wom18_in_hh other_wom1830_in_hh other_wom1830m_in_hh) ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean N, fmt(%9.2f %9.0g) label("Control mean" "N")) /// 
prehead("") ///
posthead("  & \multicolumn{5}{l}{B. Outcome: \# close outside peers in the village} \\  ") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate OLS regression. The outcome variables in panels A and B are the DIL's number of close peers in the same village and the number of close peers that are not household members, respectively. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or other caste) and village. In addition, we gradually add an indicator for residence with the FIL, the number of other women in the HH that are above 18, in the 18–30 age group, and in the married 18–30 group, as controls across columns. Control mean refers to the dependent variable mean for women who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
 sfmt(%9.2f) varwidth(25)  append

* Note:
* In the paper, Table 2 column 2 presents the coefficients using robust standard errors (SE); however, these should have been clustered.
* The current replication file corrects this mistake and updates this column with the right SE.Thus, co-residence with MIL is now statistically significant at 5% and 1% levels in panels A and B, respectively, in column 2. This correction does not affect the results or interpretation of the main paper.  


********************************************************************************
* Table 3
********************************************************************************
eststo clear
est drop _all


foreach y in visitfriend visithealth visitkirana visitshort visitmkt visit_out ghunghat{
reg `y' livewMIL $cov, cluster(village_n)
est store `y'1
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	
}



esttab  _all using "$repo/tables/table3.tex" , ///
keep(livewMIL) varlabels(livewMIL "Lives with MIL")  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(N controlmean , fmt(%9.0f %9.3f) label("N" "Control mean" )) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Mobility, OLS}\label{table:table3}\begin{tabular}{lccccccc} \toprule") ///
posthead(" &  \multicolumn{7}{c}{Outcome: DIL is usually allowed to visit the following places alone:}  \\ \midrule & \shortstack{Home of\\relatives/\\friends} & \shortstack{Health\\facility} & \shortstack{Grocery\\store} & \shortstack{Short distance\\bus/train} & Market & \shortstack{Outside village/\\community} & \shortstack{Wears\\ghunghat/\\purdah} \\  &  (1) & (2) & (3) & (4) & (5) & (6) & (7) \\ \midrule") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate regression. The outcome variables are indicators that equal one if the DIL is usually allowed to visit the respective places alone. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or other caste) and village. Control mean refers to the dependent variable mean for women who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace



********************************************************************************
* Table 4
********************************************************************************


eststo clear
est drop _all

tab sub_caste3, gen(sub_caste3_)
tab sub_caste5, gen(sub_caste5_)
* Note:
* The SC variable in the paper should be labeled as "SC or ST".
* The replication table below shows the correct label.

la var sub_caste3_1 "SC or ST"
la var sub_caste5_5  "ST"
la var sub_caste5_2 "OBC"
global selection age husb_age durationmarriage school_yrs school_gap sub_caste3_1 sub_caste5_5 sub_caste5_2 w1_hindu amountland work  num_son 

* Mean . SD of each group:
eststo mil0:  estpost  summarize $selection  if livewMIL==0
eststo mil1:  estpost  summarize  $selection   if livewMIL == 1 
* Pair-differences
eststo diff:  estpost ttest $selection , by(livewMIL) unequal 

* Export Balance Table: 
esttab mil0 mil1 diff  using  "$repo/tables/table4.tex" , ///
cells("count(pattern(1 1 0 ) fmt(0)) mean(pattern(1 1 0) fmt(3)) b(star pattern(0 0 1 ) fmt(3))" ) ///
label  collabels(none) nonum noobs starlevels(* 0.1 ** .05  *** .01) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Test for Selection into Living with MIL} \begin{tabular}{lccccc} \toprule & \multicolumn{2}{c}{Live with MIL=0} & \multicolumn{2}{c}{Live with MIL=1} & Difference       \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-6}	& N & Mean  & N   & Mean         & (2)-(4) \\	& (1)   & (2)  & (3)  & (4)  & (5)   \\ \midrule ") ///
postfoot("\bottomrule  \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table compares the average characteristics of women who do not live with the MIL (columns (1)--(2)) and women who do (columns (3)--(4)). Column (5) reports the difference in the sample mean for the two groups. SC, ST, and OBC denotes, respectively scheduled caste, scheduled tribe, and other backward class. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\) \end{tablenotes} \end{table}  ") replace


********************************************************************************
* Table 5
********************************************************************************

eststo clear
est drop _all

global cov age school_yrs i.sub_caste3 w1_hindu i.village_n amountland miss_land

*control means:
summ outsider visitfriend visithealth visitkirana visitshort visitmkt visit_out ghunghat if livewFIL==1 & livewMIL==0

foreach y in outsider visitfriend visithealth visitkirana visitshort visitmkt visit_out ghunghat{
reg `y' livewMIL $cov if livewFIL==1, cluster(village_n)
est store r`y'
sum `y'  if livewFIL==1 & livewMIL==0
estadd scalar controlmean = r(mean)	
}


esttab  routsider rvisitfriend rvisithealth rvisitkirana rvisitshort rvisitmkt rvisit_out rghunghat ///
using "$repo/tables/table5.tex" , ///
keep(livewMIL) varlabels(livewMIL "Lives with MIL")  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(N controlmean , fmt(%9.0f %9.3f) label("N" "Control mean" )) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Mobility, if FIL is co-resident, OLS regressions}\label{table:table5}\begin{tabular}{lcccccccc} \toprule") ///
posthead(" &  \multicolumn{7}{c}{Outcome: DIL is usually allowed to visit the following places alone:}  \\ \midrule & \shortstack{\# Close\\outside\\peers} &  \shortstack{Home of\\relatives/\\friends} & \shortstack{Health\\facility} & \shortstack{Grocery\\store} & \shortstack{Short\\distance\\bus/train} & Market & \shortstack{Outside\\village/\\community} & \shortstack{Wears\\ghunghat/\\purdah} \\  &  (1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) \\ \midrule & \multicolumn{8}{c}{Sample restriction: FIL co-resident} \\") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate regression. The outcome variables are the same as those in Tables 2 and 3. The sample is restricted to households where the father-in-law (FIL) is co-resident. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. Control mean refers to the dependent variable mean for women who have a co-resident FIL but who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace


********************************************************************************
* Table 6
********************************************************************************

eststo clear
est drop _all

foreach y in N_F_same_village outsider{
reg `y' livewMIL $cov if mil_approve_fp==0, cluster(village_n)
est store `y'2
sum `y'  if  livewMIL==0 &  mil_approve_fp==0
estadd scalar controlmean = r(mean)	

reg `y' livewMIL $cov if mil_approve_fp==1, cluster(village_n)
est store `y'3
sum `y'  if  livewMIL==0 &  mil_approve_fp==1
estadd scalar controlmean = r(mean)	

reg `y' livewMIL $cov if diff_wom_mil>0, cluster(village_n)
est store `y'4
sum `y'  if  livewMIL==0 & diff_wom_mil>0
estadd scalar controlmean = r(mean)	

reg `y' livewMIL $cov if diff_wom_mil<=0, cluster(village_n)
est store `y'5
sum `y'  if  livewMIL==0 & diff_wom_mil<=0
estadd scalar controlmean = r(mean)	

reg `y' livewMIL $cov if gap_mil_sons>0, cluster(village_n)
est store `y'6
sum `y'  if  livewMIL==0 & gap_mil_sons>0
estadd scalar controlmean = r(mean)	

reg `y' livewMIL $cov if gap_mil_sons<=0, cluster(village_n)
est store `y'7
sum `y'  if  livewMIL==0 & gap_mil_sons<0
estadd scalar controlmean = r(mean)	

}

esttab  N_F_same_village* using "$repo/tables/table6.tex" , ///
keep(livewMIL)  varlabels(livewMIL "Lives with MIL") ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean, fmt(%9.3f ) label("Control mean")) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Heterogeneity in the Influence of the MIL on DIL's Number of Peers, by MIL's Fertility Preferences, OLS Regressions}\label{table:table6}\begin{tabular}{lcccccc} \toprule") ///
posthead("& \shortstack{MIL\\disapproves\\to FP}  & \shortstack{MIL\\approves\\of FP} & \shortstack{$\text{Ideal Kids}^{MIL} > $ \\ $\text{Ideal Kids}^{DIL}$} & \shortstack{$\text{Idead Kids}^{MIL}$ \\ $ \leq \text{Idead Kids}^{DIL}$} & \shortstack{$\text{Idead Sons}^{MIL} > $\\ DIL's sons} & \shortstack{$\text{Idead Sons}^{MIL}  $ \\ $\leq$ DIL's sons} \\ &  (1) & (2) & (3) & (4) & (5) & (6) \\ \midrule & \multicolumn{6}{c}{A. Outcome: \# close peers in the village}  \\ ") ///
postfoot("") ///
 varwidth(25)  replace

esttab  outsider* using "$repo/tables/table6.tex",  ///
keep(livewMIL) varlabels(livewMIL "Lives with MIL") ///
mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean N, fmt(%9.3f  %9.0f ) label("Control mean" "N")) /// 
prehead("") ///
posthead("  & \multicolumn{6}{l}{B. Outcome: \# close outside peers in the village} \\  ") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column within a panel is a separate regression. The outcome variable is the number of closepeers a woman has in her village in Panel A and the number of such peers outside the household in Panel B. Columns (1) and (2) split the sample by whether the MIL approves of using FP or not. Columns (3) and (4) compare the number of children the MIL would like the DIL to have (Ideal KidsMIL) and the DIL's ideal number of children (Ideal KidsDIL). Columns (5) and (6) compare the number of sons the MIL would like the DIL to have (Ideal SonsMIL) and the DIL's numberof sons at the time of the survey (DIL sons). In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. Control mean refers to the dependent variable mean for women who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
 sfmt(%9.2f) varwidth(25)  append

********************************************************************************
* Table 7
********************************************************************************

eststo clear
est drop _all

*control means:
summ ever_visit_fp modern_method belief_fp visithealth_with if outsider==0

foreach y in ever_visit_fp modern_method belief_fp visithealth_with {
*reg `y' N_F_same_village `cov', cluster(village_n)
*est store `y'1
reg `y' outsider $cov, cluster(village_n)
est store r`y'
sum `y'  if  outsider==0
estadd scalar controlmean = r(mean)	
}


esttab  rever_visit_fp rmodern_method rbelief_fp rvisithealth_with  ///
using "$repo/tables/table7.tex" , ///
keep(outsider) varlabels(outsider " \# close outside peers")  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(N controlmean , fmt(%9.0f %9.3f) label("N" "Control mean" )) ///
prehead("\begin{table}[htpb]\begin{center} \caption{The Influence of Peers on Women's Access and Use of Family Planning, OLS Regressions}\label{table:table7}\begin{tabular}{lcccc} \toprule") ///
posthead(" &  \shortstack{Has visited\\FP clinic} &  \shortstack{Uses modern\\method} & \shortstack{Beliefs about\\FP use in\\village} & \shortstack{Allowed to\\visit health facility\\with someone} \\  &  (1) & (2) & (3) & (4)  \\ \midrule" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate regression. The key explanatory variable is a woman's number of close peers who live in her village but not in her household. The outcome variables are: an indicator for whether a woman has visited a health facility for reproductive health, fertility, or family planning services in column (1); an indicator for whether a woman is using a modern method of contraception at the time of survey in column (2); a categorical variable that takes values 0 to 6 with higher values indicating a woman's belief that more women in her village use family planning in column (3); and an indicator for whether a woman is usually allowed to visit a health facility with someone in column (4). In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. Control mean refers to the dependent variable mean for women who do not have a close outside peer in their village. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace


********************************************************************************
* Table 8
********************************************************************************

eststo clear
est drop _all

* Variables for  factor variables: 

xi i.sub_caste3*i.village_n i.age 

* Defining mobility and autonomy scores: 

gen mobi=visitfriend+visithealth+visitkirana+visitshort+visitmkt+visit_out

gen aut_health_self=(w1_w07_w1_704a==1 | w1_w07_w1_704a==3)
gen aut_purch_self=(w1_w07_w1_704b==1 | w1_w07_w1_704b==3)
gen aut_daily_self=(w1_w07_w1_704c==1 | w1_w07_w1_704c==3)
gen aut_visit_self=(w1_w07_w1_704d==1 | w1_w07_w1_704d==3)
gen aut_child_self=(w1_w07_w1_704e==1 | w1_w07_w1_704e==3)

gen aut_score_self=aut_health_self+aut_purch_self+aut_daily_self+aut_visit_self+aut_child_self
gen aut_score_self2=aut_health_self+aut_visit_self


*************************
* Columnns (1), (2): Without Caste x Village FE: 
*************************

eststo clear
est drop _all

foreach y in ever_visit_fp modern_method belief_fp visithealth_with{
* Baseline model with only pretreatment covariates: assume land is posttreatment
qui:reg `y' livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_*, cluster(village_n)
est store b_`y'
scalar `y'MIL_b = _b[livewMIL]
* Baseline model + Outsider
qui:reg `y' livewMIL outsider _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_*, cluster(village_n)
est store bo_`y'
scalar `y'MIL_bo = _b[livewMIL]
* g-estimation 
* Step 1: regress outcome on treatment, mediator, pretreatment covariates, posttreatment covariates, and intermediate confounders.
qui:reg `y' livewMIL outsider mobi aut_score_self2 _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_*, cluster(village_n)
* demediate the outcome
qui:gen `y'2 = `y' - _b[outsider]*outsider
* Regress demediated outcome on treatment and pretreatment covariates
qui:reg `y'2 livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_*, cluster(village_n)
est store g_`y'
scalar `y'MIL_g = _b[livewMIL]
drop `y'2

* computing the decline (column 3) and save it as scalar: 
estadd scalar decline1 = -100*((`y'MIL_g - `y'MIL_b) / `y'MIL_b): g_`y'

* running without cluster:
qui:reg `y' livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* 
est store b1_`y'
qui:reg `y' livewMIL outsider mobi aut_score_self2 _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_*
gen `y'2 = `y' - _b[outsider]*outsider
qui:reg `y'2 livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* 
est store g1_`y'
qui:suest b1_`y' g1_`y', cluster(village_n)
test [b1_`y'_mean]livewMIL=[g1_`y'_mean]livewMIL
* saving p-value as scalar: 
estadd scalar pval = r(p): g_`y'
drop `y'2
}


* Calculating bootstrapped SE 

capt prog drop _all
scalar drop _all
program deboot, eclass
* g-estimation: ever_visit_fp 
reg ever_visit_fp livewMIL outsider mobi husb_approve_fp _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
gen ytilde = ever_visit_fp - _b[outsider]*outsider
reg ytilde livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
scalar deffect = _b[livewMIL]
drop ytilde
end

bootstrap deffect, reps(5000) seed(12345): deboot
scalar se_boot = _se[_bs_1] 
estadd scalar se_boot = se_boot : g_ever_visit_fp

estadd scalar pvalue = r(p)
capt prog drop _all
scalar drop _all
program deboot, eclass
* g-estimation: modern_method 
reg modern_method livewMIL outsider mobi husb_approve_fp _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_*, cluster(village_n)
gen ytilde = modern_method - _b[outsider]*outsider
reg ytilde livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
scalar deffect = _b[livewMIL]
drop ytilde
end
bootstrap deffect, reps(5000) seed(12345): deboot
scalar se_boot = _se[_bs_1] 
estadd scalar se_boot = se_boot : g_modern_method


capt prog drop _all
scalar drop _all
program deboot, eclass
* g-estimation: belief_fp 
reg belief_fp livewMIL outsider mobi husb_approve_fp _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
gen ytilde = belief_fp - _b[outsider]*outsider
reg ytilde livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
scalar deffect = _b[livewMIL]
drop ytilde
end
bootstrap deffect, reps(5000) seed(12345): deboot
scalar se_boot = _se[_bs_1] 
estadd scalar se_boot = se_boot : g_belief_fp

capt prog drop _all
scalar drop _all
program deboot, eclass
* g-estimation: visithealth_with 
reg visithealth_with livewMIL outsider mobi husb_approve_fp _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
gen ytilde = visithealth_with - _b[outsider]*outsider
reg ytilde livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* , cluster(village_n)
scalar deffect = _b[livewMIL]
drop ytilde
end
bootstrap deffect, reps(5000) seed(12345): deboot
scalar se_boot = _se[_bs_1] 
estadd scalar se_boot = se_boot : g_visithealth_with


*************************
* Columnns (4), (5): With Caste x Village FE: 
*************************

foreach y in ever_visit_fp modern_method belief_fp visithealth_with{
* Baseline model with only pretreatment covariates: assume land is posttreatment
qui:reg `y' livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*, cluster(village_n)
est store b2_`y'
scalar `y'MIL_b = _b[livewMIL]
* Baseline model + Outsider
qui:reg `y' livewMIL outsider _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*, cluster(village_n)
est store bo2_`y'
scalar `y'MIL_bo = _b[livewMIL]
* g-estimation 
* Step 1: regress outcome on treatment, mediator, pretreatment covariates, posttreatment covariates, and intermediate confounders.
qui:reg `y' livewMIL outsider mobi aut_score_self2 _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*, cluster(village_n)
* demediate the outcome
qui:gen `y'2 = `y' - _b[outsider]*outsider
* Regress demediated outcome on treatment and pretreatment covariates
qui:reg `y'2 livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*, cluster(village_n)
est store g2_`y'
scalar `y'MIL_g = _b[livewMIL]
drop `y'2

* computing the decline (column 3) and save it as scalar: 
estadd scalar decline1 =  -100*((`y'MIL_g - `y'MIL_b) / `y'MIL_b):g2_`y'

* running without cluster:
qui:reg `y' livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_*  _IsubXvil*
est store b1_`y'
qui:reg `y' livewMIL outsider mobi aut_score_self2 _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*
gen `y'2 = `y' - _b[outsider]*outsider
qui:reg `y'2 livewMIL _Iage* school_yrs w1_hindu _Isub_caste_* _Ivillage_n_*  _IsubXvil*
est store g1_`y'
qui:suest b1_`y' g1_`y', cluster(village_n)
qui: test [b1_`y'_mean]livewMIL=[g1_`y'_mean]livewMIL
* saving p-value as scalar: 
estadd scalar pval = r(p): g2_`y'

drop `y'2
}


*************************
* Exporting table 
*************************

esttab  b_ever_visit_fp g_ever_visit_fp b2_ever_visit_fp g2_ever_visit_fp ///
using  "$repo/tables/table8.tex"  ,  ///
keep(livewMIL) varlabels(livewMIL "MIL") b(3) se(3) noline mlabels(none) nonum starlevels( * 0.1 ** .05  *** .01)   brackets ///
stats(se_boot N decline1 pval , layout(`"(@)"' @ `"@\%"' @ ) label("WC Bootstrap" "N" "decline" "p-value") fmt(%9.3f %9.0f %9.0f %9.4f)) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Mediation Analysis}\label{table:table8}\begin{tabular}{lccccc} \toprule") ///
posthead("&  ATE  & ACDE (g-est) & ATE & ACDE (g-est) \\ &  (1) & (2) & (3) & (4)  \\ \midrule & \multicolumn{4}{c}{A. Has visited FP clinic}  \\ ") ///
postfoot("") ///
 varwidth(25)  replace

esttab  b_modern_method  g_modern_method b2_modern_method  g2_modern_method   ///
using  "$repo/tables/table8.tex"  ,  ///
keep(livewMIL) varlabels(livewMIL "MIL") b(3) se(3) noline mlabels(none) nonum starlevels( * 0.1 ** .05  *** .01)   brackets ///
stats(se_boot N  pval , layout(`"(@)"' @  @ ) label("WC Bootstrap" "N"  "p-value") fmt(%9.3f %9.0f %9.4f) ) ///
prehead("") ///
posthead(" & \multicolumn{4}{c}{B. Uses modern method} \\ ") ///
postfoot("") ///
 varwidth(25)  append


esttab  b_belief_fp  g_belief_fp b2_belief_fp  g2_belief_fp    ///
using  "$repo/tables/table8.tex"  ,  ///
keep(livewMIL) varlabels(livewMIL "MIL") b(3) se(3) noline mlabels(none) nonum starlevels( * 0.1 ** .05  *** .01)   brackets ///
stats(se_boot N decline1 pval , layout(`"(@)"' @ `"@\%"' @ ) label("WC Bootstrap" "N" "decline" "p-value") fmt(%9.3f %9.0f %9.0f %9.4f)) ///
prehead("") ///
posthead(" & \multicolumn{4}{c}{C. Beliefs about FP use in village}  \\ ") ///
postfoot("") ///
 varwidth(25)  append


esttab  b_visithealth_with  g_visithealth_with b2_visithealth_with  g2_visithealth_with    ///
using  "$repo/tables/table8.tex"  ,  ///
keep(livewMIL) varlabels(livewMIL "MIL") b(3) se(3) noline mlabels(none) nonum starlevels( * 0.1 ** .05  *** .01)   brackets ///
stats(se_boot N decline1 pval , layout(`"(@)"' @ `"@\%"' @ ) label("WC Bootstrap" "N" "decline" "p-value") fmt(%9.3f %9.0f %9.0f %9.4f)) ///
prehead("") ///
posthead(" & \multicolumn{4}{c}{D. allowed to visit health facility with someone}  \\ ") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} The p-values test if the estimates of ACDE from sequential g-estimation are significantly different from the estimated ATE. In columns (3) and (4), the specification includes Caste x Village FE. Standard errors in brackets are clustered at the village level and in parentheses are bootstrapped.\sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
 varwidth(25)  append
 
* Note:
* In table 8, column 3, panel B of the paper: p-values are in the wrong place. This is, 0.0006 should be 0.0009 and 0.0009 should be 0.0006
* In this replication table we have the columns in the right order. 

********************************************************************************
* Table 9
********************************************************************************

eststo clear
est drop _all

foreach y in ever_visit_fp ever_visit_fp modern_method belief_fp visitfriend visithealth_with{

qui:ivreg2 `y' (outsider = prop_wom_vill_mil)  prop_wom_vill , first  savefp(f1_`y') saverfp(rf1)  cluster(village_n)  
est store r1`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest :f1_`y'outsider

qui:ivreg2 `y' (outsider = prop_wom_vill_mil)  _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*  , first  savefp(f2_`y') saverfp(rf2_`y') cluster(village_n)    partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r2`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest:f2_`y'outsider
estadd local control "x":f2_`y'outsider
estadd local caste "x":f2_`y'outsider
estadd local village "x":f2_`y'outsider
estadd local castevillage  "x":f2_`y'outsider

qui:ivreg2 `y' (outsider = prop_wom_vill_1830_mil)  prop_wom_vill  , first  savefp(f3_`y') saverfp(rf3)  cluster(village_n)  
est store r3`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest :f3_`y'outsider

qui:ivreg2 `y' (outsider = prop_wom_vill_1830_mil)    _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first  savefp(f4_`y') saverfp(rf4_`y')  cluster(village_n)    partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r4`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest:f4_`y'outsider
estadd local control "x":f4_`y'outsider
estadd local caste "x":f4_`y'outsider
estadd local village "x":f4_`y'outsider
estadd local castevillage  "x":f4_`y'outsider

qui:ivreg2 `y' (outsider = prop_wom_vill_1830m_mil)  prop_wom_vill , first  savefp(f5_`y') saverfp(rf5)  cluster(village_n)  
est store r5`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest :f5_`y'outsider
qui:ivreg2 `y' (outsider = prop_wom_vill_1830m_mil)    _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first  savefp(f6_`y') saverfp(rf6)  cluster(village_n)   partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r6`y'
scalar ftest = e(first)[4,1]
estadd scalar ftest = ftest :f6_`y'outsider
estadd local control "x": f6_`y'outsider
estadd local caste "x":f6_`y'outsider
estadd local village "x":f6_`y'outsider
estadd local castevillage  "x":f6_`y'outsider
}

* Export table:
  
 esttab   f1_ever_visit_fpoutsider f2_ever_visit_fpoutsider f3_ever_visit_fpoutsider ///
 f4_ever_visit_fpoutsider f5_ever_visit_fpoutsider f6_ever_visit_fpoutsider ///
 using  "$repo/tables/table9.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps /// 
 stats(N ftest control caste village castevillage, label("N"  "First stage F-stat" " $ X\_i $ " "Caste FE" "Village FE"  "Caste x Village FE") fmt(%9.0f %9.2f)) /// 
 rename(prop_wom_vill_1830_mil prop_wom_vill_mil  prop_wom_vill_1830m_mil prop_wom_vill_mil) keep(prop_wom_vill_mil prop_wom_vill ) ///
 varlabels(prop_wom_vill_mil " $ {Prop}_{cv} \times MIL_{i} $" prop_wom_vill " $ Prop_{cv} $ ")  substitute("\_" "_") ///
 prehead("\begin{table}[htpb]\begin{center} \caption{First-Stage Results from 2SLS Regressions}\label{table:table9}\begin{tabular}{lcccccc} \toprule") ///
posthead(" & \multicolumn{6}{c}{Outcome: No. of close outisde peers in village} \\ \cmidrule(lr){2-7} & \multicolumn{2}{c}{ $ Prop_{cv} $ } & \multicolumn{2}{c}{ $ Prop_{cv}^{1830} $ } & \multicolumn{2}{c}{ $ Prop_{cv}^{1830, married} $ }  \\ \cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}  &  (1) & (2) & (3) & (4) & (5) & (6)  \\ \midrule" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from two versions of specification (5); in columns (1), (3), and (5), we only include Propcv * MILi and Propcv as explanatory variables, while the rest of the columns estimate the full version of specification (5). Each column is a separate regression. The outcome variable is a woman's number of close peers who live in her village but not in her household. Across columns, we use the three definitions of the peer pool described in the text. Robust standard errors in brackets are clustered at the village level. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace
 

 * Note:
 * In the paper, Column (3) and (5) of Table 9 are slightly different at the third decimal place. 
 * This marginal change could be explained by the use of different Stata version of ivreg2. Originally, the regressions were obtained using Stata 11,
 * while the replication do-file and corresponding results are obtained using Stata 17.
 * Please check README file for further details on the Stata package versions used in this replication do-file.
 
 
********************************************************************************
* Table 10
********************************************************************************
 
esttab r6ever_visit_fp  r6modern_method r6belief_fp r6visithealth_with ///
using  "$repo/tables/table10.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(outsider) varlabels(outsider "\# close outside peers") ///
prehead("\begin{table}[htpb]\begin{center} \caption{Second stage and Reduced Form Results from 2SLS Results}\label{table:table10}\begin{tabular}{lcccc} \toprule") ///
posthead(" &  \shortstack{Visited FP\\clinic} & \shortstack{Use modern\\method}  & \shortstack{Beliefs about FP\\use in village} & \shortstack{Allowed to visit health\\facility with someone} \\ & (1) & (2) & (3) & (4)  \\ \midrule \multicolumn{5}{l}{A. Second Stage} \\" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace
 
esttab rf6ever_visit_fp  rf6modern_method rf6belief_fp rf6visithealth_with ///
using  "$repo/tables/table10.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(prop_wom_vill_1830m_mil) varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv} \times MIL_{i} $ " ) substitute("\_" "_")  stats(N, label("N") fmt(%9.0f)) /// 
prehead("") ///
posthead("\multicolumn{5}{l}{B. Reduced Form} \\" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (6) in PanelAand the reduced form estimates for our IV estimation in Panel B. Each coefficient is from a separate regression. The outcome variables are: an indicator for whether a woman has ever visited a health facility for reproductive health, fertility, or family planning services in column (1); an indicator for whether a woman is using a modern method of contraception at the time of survey in column (2); a categorical variable that takes values 0 to 6 with higher values indicating a woman's belief that more women in her village use family planning in column (3); and an indicator for whether a woman is usually allowed to visit a health facility with someone in column (4). Robust standard errors in brackets are clustered at the village level. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append


********************************************************************************
* Table 11
********************************************************************************

eststo clear
est drop _all

foreach y in firstbornson dispute wom_mot_school wom_fat_school{
ivreg2 `y' (outsider = prop_wom_vill_1830m_mil) _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil*, first savefp(f1_`y') saverfp(rf1) cluster(village_n)  partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r`y'
}


esttab rfirstbornson rdispute rwom_mot_school rwom_fat_school ///
using  "$repo/tables/table11.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(outsider) varlabels(outsider "\# close outside peers") ///
prehead("\begin{table}[htpb]\begin{center} \caption{Placebo Tests}\label{table:table11}\begin{tabular}{lcccc} \toprule") ///
posthead(" &  \shortstack{Firstborn\\is son} & \shortstack{Involved in\\land dispute}  & \shortstack{Mother attended\\school} & \shortstack{Father attended\\school} \\ & (1) & (2) & (3) & (4)  \\ \midrule \multicolumn{5}{l}{A. Second Stage} \\" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace
 
esttab  rf1firstbornson rf1dispute rf1wom_mot_school rf1wom_fat_school ///
using  "$repo/tables/table11.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(prop_wom_vill_1830m_mil) varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv}  \times MIL_{i} $ " )  substitute("\_" "_")  stats(N, label("N") fmt(%9.0f)) /// 
prehead("") ///
posthead("\multicolumn{5}{l}{B. Reduced Form} \\" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (6) in PanelAand the reduced form estimates for our IV estimation in Panel B. Each column is a separate regression. The outcome variables are indicators that equal one if the firstborn child of the woman is a son in column (1), if her household is involved in a land dispute in column (2), if her mother attended school in column (3), and if her father attended school in column (4). Robust standard errors in brackets are clustered at the village level.\sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append


********************************************************************************
* Figure 1
********************************************************************************

set scheme s2color
graph set window fontface default
grstyle init
grstyle set plain

grstyle set horizontal
qui: npregress kernel outsider prop_wom_vill_1830m_mil 
npgraph, noscatter  name(g1, replace)  xtitle("Prop * MIL") ytitle("ClosePeers") title("Mean funcion of ClosePeers") 

npregress kernel outsider prop_wom_vill_1830m_mil, kernel(gaussian)
npgraph, noscatter  name(g2, replace)  xtitle("Prop * MIL") ytitle("ClosePeers") title("Mean funcion of ClosePeers") 

npregress kernel outsider prop_wom_vill_1830m_mil, estimator(constant)
npgraph, noscatter  name(g3, replace)  xtitle("Prop * MIL") ytitle("ClosePeers") title("Mean funcion of ClosePeers") 

* Note: 
* The following figure uses the same optimal bandwidth as the one obtained originally by npregress in the paper.
* The new version of npregress in Stata 17 computes a different optimal bandwidth.
* For replication purposes, we keep the original bandwith computed in past versions of the function.
* Please check README file for further details on the Stata package versions used in this material.
 
npregress kernel outsider prop_wom_vill_1830m_mil, imaic meanbwidth(.2376723, copy)
npgraph, noscatter  name(g4, replace)  xtitle("Prop * MIL") ytitle("ClosePeers") title("Mean funcion of ClosePeers") 


graph combine g1 g2 g3 g4 , col(2) name(fig1, replace) iscale(0.6)
graph display fig1, ysize(10) xsize(12)  
graph export "$repo/figure/figure1.pdf", replace   



********************************************************************************
****************** ONLINE APPENDIX / TABLES ************************************
********************************************************************************


********************************************************************************
* Table A.1
********************************************************************************

eststo clear
est drop _all

global cov age school_yrs i.sub_caste3 w1_hindu i.village_n 

foreach y in N_F_same_village outsider{
qui: reg `y' livewMIL $cov, cluster(village_n)
est store `y'1
sum `y'  if  livewMIL==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL $cov, cluster(village_n)
est store `y'2
sum `y'  if  livewMIL==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom18_in_hh $cov, cluster(village_n)
est store `y'3
sum `y'  if  livewMIL==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom1830_in_hh $cov, cluster(village_n)
est store `y'4
sum `y'  if  livewMIL==0
estadd scalar controlmean = r(mean)	

qui: reg `y' livewMIL livewFIL other_wom1830m_in_hh $cov, cluster(village_n)
est store `y'5
sum `y'  if  livewMIL==0
estadd scalar controlmean = r(mean)	

}


esttab  N_F_same_village* using "$repo/tables/appendix_table1.tex" , ///
keep(livewMIL livewFIL other_wom18_in_hh other_wom1830_in_hh other_wom1830m_in_hh)  ///
varlabels(livewMIL "Mother-in-law"  livewFIL "Father-in-Law"  other_wom18_in_hh "\# other women $>$ age 18"  other_wom1830_in_hh "\# other 18-30 women" other_wom1830m_in_hh "\# other 18-30 married women" ) ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean, fmt(%9.3f) label("Control mean")) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Number of Peers, excluding landholding control, OLS Regressions}\label{table:app-table1}\begin{tabular}{lccccc} \toprule") ///
posthead("\emph{Co-residence with:} &  (1) & (2) & (3) & (4) & (5)  \\ \midrule & \multicolumn{5}{c}{\textbf{A. Outcome: \# close peers in the village}} \\ \midrule ") ///
postfoot("") ///
 varwidth(25)  replace

esttab  outsider* using "$repo/tables/appendix_table1.tex",  ///
 keep(livewMIL livewFIL other_wom18_in_hh other_wom1830_in_hh other_wom1830m_in_hh)  ///
 varlabels(livewMIL "Mother-in-law"  livewFIL "Father-in-Law"  other_wom18_in_hh "\# other women $>$ age 18"  other_wom1830_in_hh "\# other 18-30 women" other_wom1830m_in_hh "\# other 18-30 married women" ) ///
mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(controlmean N, fmt(%9.3f %9.0f) label("\midrule Control mean" "N")) /// 
prehead("\midrule") ///
posthead("  & \multicolumn{5}{l}{\textbf{B. Outcome: \# close outside peers in the village}} \\ \midrule ") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes}This table reports coefficients from specification (1). Each column is a separate OLS regression. The outcome variables in panels A and B are the DIL's number of close peers in the same village and the number of close peers that are not household members, respectively. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. In addition, we gradually add an indicator for residence with the FIL, the number of other women in the HH that are above 18, in the 18-30 age group, and in the married 18-30 group, as controls across columns. Control mean refers to the dependent variable mean for women who do not live with their MIL. Standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
 sfmt(%9.2f) varwidth(25)  append
 
 
********************************************************************************
* Table A.2
********************************************************************************

eststo clear
est drop _all

global cov age school_yrs i.sub_caste3 w1_hindu i.village_n 


foreach y in visitfriend visithealth visitkirana visitshort visitmkt visit_out ghunghat{
reg `y' livewMIL $cov, cluster(village_n)
est store r`y'
sum `y'  if livewMIL ==0
estadd scalar controlmean = r(mean)	
}

estout _all , cells(b(star fmt(%9.3f)) se(par( [ ] ) fmt(%9.3f))) starlevels( * 0.1 ** .05  *** .01) stats(N controlmean, fmt(%9.0f %9.3f)) keep(livewMIL)  replace



esttab  rvisitfriend rvisithealth rvisitkirana rvisitshort rvisitmkt rvisit_out rghunghat ///
using "$repo/tables/appendix_table2.tex" , ///
keep(livewMIL) varlabels(livewMIL "MIL")  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(N controlmean , fmt(%9.0f %9.3f) label("\midrule N" "Control mean" )) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Mobility, if FIL is co-resident, OLS regressions}\label{table:app-table2}\begin{tabular}{lccccccc} \toprule") ///
posthead(" &  \multicolumn{7}{c}{Outcome: DIL is usually allowed to visit the following places alone:}  \\ \midrule &   \shortstack{Home of\\relatives/\\friends} & \shortstack{Health\\facility} & \shortstack{Grocery\\store} & \shortstack{Short\\distance\\bus/train} & Market & \shortstack{Outside\\village/\\community} & \shortstack{Wears\\ghunghat/\\purdah} \\  &  (1) & (2) & (3) & (4) & (5) & (6) & (7)  \\ \midrule") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate regression. The outcome variables are the same as those in Tables 2 and 3. The sample is restricted to households where the father-in-law (FIL) is co-resident. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. Control mean refers to the dependent variable mean for women who have a co-resident FIL but who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace


********************************************************************************
* Table A.3
********************************************************************************
eststo clear
est drop _all

global cov age school_yrs i.sub_caste3 w1_hindu i.village_n amountland miss_land

* Note:
* In the Online Appendix of the paper, the control outcome mean in Table A.3 is calculated for the sub-sample specified in each column 
* (i.e., outcome mean for close outside peers when marital duration <=5). However, the footnote of the table mentioned that "control mean" 
* refers to the dependent variable mean for women who do not live with their MIL. In this replication material, 
* we include two control outcome-mean rows. The first one follows the footnote specification (i.e., conditional on co-residence with MIL 
* and the covariate specified in the column),and the second row is the control outcome mean that is presented in the original version
*  of the appendix table. The main results of the paper are not altered by the addition of this row in the Online Appendix Table A.3.

 

foreach y in outsider{
reg `y' livewMIL $cov if duration<=5, cluster(village_n)
est store `y'1
sum `y'  if livewMIL ==0 & duration<=5
estadd scalar controlmean = r(mean)	

sum `y'  if duration<=5
estadd scalar controlmean2 = r(mean)	

reg `y' livewMIL $cov if duration>5, cluster(village_n)
est store `y'2
sum `y'  if livewMIL ==0 & duration>5
estadd scalar controlmean = r(mean)	

sum `y'  if  duration>5
estadd scalar controlmean2 = r(mean)	

reg `y' livewMIL $cov if husb_approve_fp==0, cluster(village_n)
est store `y'3
sum `y'  if livewMIL ==0 & husb_approve_fp==0
estadd scalar controlmean = r(mean)	

sum `y'  if  husb_approve_fp==0
estadd scalar controlmean2 = r(mean)	

reg `y' livewMIL $cov if husb_approve_fp==1, cluster(village_n)
est store `y'4
sum `y'  if livewMIL ==0 & husb_approve_fp==1
estadd scalar controlmean = r(mean)	

sum `y'  if  husb_approve_fp==1
estadd scalar controlmean2 = r(mean)	

reg `y' livewMIL $cov if w1_husband_migrate1==1, cluster(village_n)
est store `y'5

sum `y'  if livewMIL ==0 &  w1_husband_migrate1==1
estadd scalar controlmean = r(mean)	

sum `y'  if   w1_husband_migrate1==1
estadd scalar controlmean2 = r(mean)

reg `y' livewMIL $cov if w1_husband_migrate1==0, cluster(village_n)
est store `y'6
sum `y'  if livewMIL ==0 & w1_husband_migrate1==0
estadd scalar controlmean = r(mean)	

sum `y'  if  w1_husband_migrate1==0
estadd scalar controlmean2 = r(mean)	

}


esttab  _all ///
using "$repo/tables/appendix_table3.tex" , ///
keep(livewMIL) varlabels(livewMIL "Lives with MIL")  ///
label mlabels(none) collabels(none)  se(%9.3f) b(%9.3f)  ///
brackets nonum  noobs nolines  nogaps starlevels( * 0.1 ** .05  *** .01) ///
stats(N controlmean controlmean2 , fmt(%9.0f %9.3f) label("\midrule N" "Control mean (new)" "Control mean (original)" )) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Influence of the MIL on DIL's Mobility, if FIL is co-resident, OLS regressions}\label{table:app-table3}\begin{tabular}{lcccccc} \toprule") ///
posthead(" &  \multicolumn{6}{c}{\textbf{Outcome: \# close outside peers in village}}  \\ \midrule &   \shortstack{Marital\\duration $\leq$ 5} & \shortstack{Marital\\duration $>$ 5} & \shortstack{Husband\\disapproves of FP} & \shortstack{Husband\\approves of FP}  & \shortstack{Husband\\migrant} & \shortstack{Husband\\not migrant} \\  &  (1) & (2) & (3) & (4) & (5) & (6)  \\ \midrule") ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (1). Each column is a separate regression. The outcome variables are the same as those in Tables 2 and 3. The sample is restricted to households where the father-in-law (FIL) is co-resident. In all cases, we control for the DIL's age, years of schooling, Hindu dummy, amount of land owned by the household, and fixed effects for her caste category (SC-ST, OBC, or Other caste) and village. Control mean refers to the dependent variable mean for women who have a co-resident FIL but who do not live with their MIL. Robust standard errors in brackets are clustered by village. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  replace

********************************************************************************
* Table A.4
********************************************************************************

eststo clear
est drop _all

foreach y in ever_visit_fp ever_visit_fp modern_method belief_fp visitfriend visithealth_with{

qui:ivreg2 `y' (outsider = prop_wom_vill_1830m_mil)    _Iage* school_yrs   w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first  savefp(f_`y') saverfp(rf)  cluster(village_n)   partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r`y'
}

 
esttab rever_visit_fp  rmodern_method rbelief_fp rvisithealth_with ///
using  "$repo/tables/appendix_table4.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(outsider) varlabels(outsider "\# close outside peers") ///
prehead("\begin{table}[htpb]\begin{center} \caption{Second stage and Reduced Form Results from 2SLS Results}\label{table:app-table4}\begin{tabular}{lcccc} \toprule") ///
posthead(" &  \shortstack{Visited FP\\clinic} & \shortstack{Use modern\\method}  & \shortstack{Beliefs about FP\\use in village} & \shortstack{Allowed to visit health\\facility with someone} \\ & (1) & (2) & (3) & (4)  \\ \midrule \multicolumn{5}{l}{A. Second Stage} \\" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace
 
esttab  rfever_visit_fp  rfmodern_method rfbelief_fp rfvisithealth_with ///
using  "$repo/tables/appendix_table4.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(prop_wom_vill_1830m_mil) varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv} \times MIL_{i} $ " ) substitute("\_" "_")  stats(N, label("\midrule N") fmt(%9.0f)) /// 
prehead("") ///
posthead("\multicolumn{5}{l}{B. Reduced Form} \\" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (6) in Panel A and the reduced form estimates for our IV estimation in Panel B. Each coefficient is from a separate regression. The outcome variables are: an indicator for whether a woman has ever-visited a health facility for reproductive health, fertility, or family planning services in column (1); an indicator for whether a woman is using a modern method of contraception at the time of survey in column (2); a categorical variable that takes values 0 to 6 with higher values indicating a woman's belief that more women in her village use family planning in column (3); and an indicator for whether a woman is usually allowed to visit a health facility with someone in column (4). Standard errors in brackets are clustered at the village level. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append



********************************************************************************
* Table A.5
********************************************************************************


eststo clear
est drop _all

foreach y in ever_visit_fp modern_method belief_fp visithealth_with {

ivreg2 `y' (outsider = prop_wom_vill_1830m_mil)    _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first  savefp(fs) saverfp(rf)  cluster(village_n)   partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r`y'

boottest outsider, reps(1000) seed(7221987) weight(webb) nograph

estadd scalar pvalue = r(p)
matrix CI_temp = r(CI)
scalar ci_lb = CI_temp[1,1]
scalar ci_ub = CI_temp[1,2]
estadd scalar ci_lower = ci_lb
estadd scalar ci_upper = ci_ub
}

 * Note:
 * WC Bootstrapped CI and p-values are different in this replication table than in the original version of the Online Appendix.
 * This change could be explained by the use of different versions of boottest Stata package. 
 * Originally, the command was ran using Stata 11, while this replication material is obtained using Stata 17.
 * Please check README file for further details on the packages version used in this material.
 
esttab rever_visit_fp rmodern_method rbelief_fp rvisithealth_with   ///
using  "$repo/tables/appendix_table5.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps  staraux ///
keep(outsider) varlabels(outsider "\# close outside peers")  ///
stats(ci_lower ci_upper pvalue, layout(`""(@;@)""' @) label("WC Bootstrapped CI" "WC Bootstrap p-values") fmt(%9.3f %9.3f)) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Second stage and Reduced Form Results from 2SLS Results, with wild cluster bootstrapped standard errors}\label{table:app-table5}\begin{tabular}{lcccc} \toprule") ///
posthead(" &  \shortstack{Visited FP\\clinic} & \shortstack{Use modern\\method}  & \shortstack{Beliefs about FP\\use in village} & \shortstack{Allowed to visit health\\facility with someone} \\ & (1) & (2) & (3) & (4)  \\ \midrule \multicolumn{5}{l}{A. Second Stage} \\" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace


esttab rfever_visit_fp rfmodern_method rfbelief_fp rfvisithealth_with  ///
using  "$repo/tables/appendix_table5.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps  staraux ///
keep(prop_wom_vill_1830m_mil) varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv} \times MIL_{i} $ " ) substitute("\_" "_")  stats(N, label("\midrule N") fmt(%9.0f)) /// 
prehead("") ///
posthead("\midrule \multicolumn{5}{l}{B. Reduced Form} \\" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (6) in Panel A and the reduced form estimates for our IV estimation in Panel B. Each coefficient is from a separate regression. The outcome variables are: an indicator for whether a woman has ever-visited a health facility for reproductive health, fertility, or family planning services in column (1); an indicator for whether a woman is using a modern method of contraception at the time of survey in column (2); a categorical variable that takes values 0 to 6 with higher values indicating a woman's belief that more women in her village use family planning in column (3); and an indicator for whether a woman is usually allowed to visit a health facility with someone in column (4). Standard errors in brackets are clustered at the village level. In Panel A, we also report bootstrapped confidence intervals and associated p-values using the wild cluster bootstrap method with 1,000 replications and a Webb six-point distribution. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append

********************************************************************************
* Table A.6
********************************************************************************
eststo clear
est drop _all

* EDUCATION
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if school_yrs<=10, cluster(village_n)
est store e1
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if school_yrs>10 & school_yrs<., cluster(village_n)
est store e2
* NO DIFFERENCE BY AGE
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if age<=26, cluster(village_n)
est store e3
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if age>26, cluster(village_n)
est store e4
* MIGRATION
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if w1_husband_migrate1==1, cluster(village_n)
est store e5
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if w1_husband_migrate1==0, cluster(village_n)
est store e6
* MIL APPROVAL
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if mil_approve_fp==0, cluster(village_n)
est store e7
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if mil_approve_fp==1, cluster(village_n)
est store e8
* MIL WANTS MORE
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if diff_wom_mil>0, cluster(village_n)
est store e9
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if diff_wom_mil<=0, cluster(village_n)
est store e10
* GAP IN SON PREF
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if gap_mil_sons>0, cluster(village_n)
est store e11
reg outsider prop_wom_vill_1830m_mil _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if gap_mil_sons<=0, cluster(village_n)
est store e12


esttab e1 e2 e3 e4 e5 e6   ///
using  "$repo/tables/appendix_table6.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps   ///
keep(prop_wom_vill_1830m_mil)  varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv} \times MIL_{i} $ " ) substitute("\_" "_") ///
stats(N, label("N") fmt(%9.0f)) ///
prehead("\begin{table}[htpb]\begin{center} \caption{Compliers in the first-stage results from 2SLS regressions}\label{table:app-table6}\begin{tabular}{lcccccc} \toprule") ///
posthead(" &  \multicolumn{6}{c}{\textbf{Outcome: \# of close outside peers in village}} \\ \midrule & \multicolumn{2}{c}{DIL's years of schooling} & \multicolumn{2}{c}{DIL's age} $ $ \\ \cmidrule(lr){2-3}\cmidrule(lr){4-5} & $\leq$ 10 & $>$ 10 & $\leq$ 26 & $>$ 26 & \shortstack{Husband\\migrant} & \shortstack{Husband\\not migrant} \\ & (1) & (2) & (3) & (4) & (5) & (6)  \\ \midrule" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace


esttab  e7 e8 e9 e10  e11 e12  ///
using  "$repo/tables/appendix_table6.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps   ///
keep(prop_wom_vill_1830m_mil) varlabels(prop_wom_vill_1830m_mil " $ Prop_{cv} \times MIL_{i} $ " ) substitute("\_" "_") ///
 stats(N, label("N") fmt(%9.0f)) /// 
prehead("\midrule & \shortstack{MIL\\disapproves\\to FP}  & \shortstack{MIL\\approves\\of FP} & \shortstack{$\text{Ideal Kids}^{MIL} > $ \\ $\text{Ideal Kids}^{DIL}$} & \shortstack{$\text{Idead Kids}^{MIL}$ \\ $ \leq \text{Idead Kids}^{DIL}$} & \shortstack{$\text{Idead Sons}^{MIL} > $\\ DIL's sons} & \shortstack{$\text{Idead Sons}^{MIL}  $ \\ $\leq$ DIL's sons} \\ \midrule  & (7) & (8) & (9) & (10) & (11) & (12)  \\ \midrule ") ///
posthead("" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specification (5) for various sub-samples. Each column is a separate regression. The outcome variable is a woman's number of close peers who live in her village but not in her household. Standard errors in brackets are clustered at the village level. \sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append


********************************************************************************
* Table A.7
********************************************************************************
eststo clear
est drop _all

gen x=1
bys village_n:egen count=sum(x)
drop x

*global ideal husb_ideal_daugh husb_ideal_sons wom_ideal_daugh wom_ideal_sons
global ideal husb_ideal_daugh husb_ideal_sons wom_ideal_daugh wom_ideal_sons mil_ideal_sons mil_ideal_daugh

* column 1  
ivreg2 ever_visit_fp (outsider = prop_wom_vill_1830m_mil) _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* $ideal , first savefp(fs1) saverfp(rf1)  cluster(village_n) partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r1
 * column 2 
ivreg2 ever_visit_fp (outsider = prop_wom_vill_mil) _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first savefp(fs2) saverfp(rf2)  cluster(village_n) partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r2
* column 3 
 ivreg2 ever_visit_fp (outsider = prop_wom_vill_1830_mil) _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* , first savefp(fs3) saverfp(rf3)  cluster(village_n) partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r3
* column 4 
ivreg2 ever_visit_fp (outsider = prop_wom_vill_1830m_mil) _Iage* school_yrs amountland miss_land w1_hindu _Isub_caste_* _Ivillage_n_* _IsubXvil* if count>10, first savefp(fs4) saverfp(rf4)  cluster(village_n) partial(_Isub_caste_* _Ivillage_n_* _IsubXvil*  _Iage*)
est store r4


* Export table:

esttab   fs1outsider fs2outsider fs3outsider fs4outsider ///
using  "$repo/tables/appendix_table7.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps /// 
rename(prop_wom_vill_mil prop_wom_vill_1830m_mil prop_wom_vill_1830_mil prop_wom_vill_1830m_mil) keep(prop_wom_vill_1830m_mil ) ///
varlabels(prop_wom_vill_1830m_mil " $ {Prop}_{cv} \times MIL_{i} $")  substitute("\_" "_") ///
prehead("\begin{table}[htpb]\begin{center} \caption{Robustness Checks}\label{table:app-table7}\begin{tabular}{lcccc} \toprule") ///
posthead(" & \multicolumn{4}{c}{\textbf{Outcome: Visited FP clinic}} \\  &  (1) & (2) & (3) & (4)  \\ \midrule   \textbf{A. First Stage} & \multicolumn{4}{c}{Outcome: \# close outside peers}  \\ \cmidrule(lr){2-5} " ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  replace

esttab r1 r2 r3 r4 ///
using  "$repo/tables/appendix_table7.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
keep(outsider) varlabels(outsider "\# close outside peers") ///
prehead("") ///
posthead("\midrule \textbf{B. Second Stage} & & & & \\" ) ///
postfoot("") ///
sfmt(%9.2f) varwidth(25)  append
 
 
esttab  rf1ever_visit_fp rf2ever_visit_fp rf3ever_visit_fp rf4ever_visit_fp ///
using  "$repo/tables/appendix_table7.tex"  ,  ///
starlevels( * 0.1 ** .05  *** .01) mlabels(none) collabels(none) nonum nolines ///
se(%9.3f) b(%9.3f)  brackets  noobs  nogaps ///
 stats(N, label("\midrule N") fmt(%9.0f)) /// 
rename(prop_wom_vill_mil prop_wom_vill_1830m_mil prop_wom_vill_1830_mil prop_wom_vill_1830m_mil) keep(prop_wom_vill_1830m_mil ) ///
varlabels(prop_wom_vill_1830m_mil " $ {Prop}_{cv} \times MIL_{i} $")  substitute("\_" "_") ///
prehead("") ///
posthead("\midrule \textbf{C. Reduced Form} & & & &  \\" ) ///
postfoot("\bottomrule \\[-5ex] \end{tabular} \end{center} \begin{tablenotes} This table reports coefficients from specifications (5) and (6) in Panels A and B, and the reduced form estimates for our IV estimation in Panel C. Each coefficient is from a separate regression. The outcome variable is an indicator for the woman having visited a health facility for reproductive health, fertility, or family planning services. Standard errors in brackets are clustered at the village level.\sym{*}\(p<0.1\),\sym{**}\(p<0.05\),\sym{***}\(p<0.01\). \end{tablenotes} \end{table}") ///
sfmt(%9.2f) varwidth(25)  append

